package com.trkj.dao.mybatis;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.hibernate.annotations.Parent;

import com.trkj.pojos.ChargeprojectTable;
import com.trkj.pojos.PayTable;
import com.trkj.pojos.TallyTable;
import com.trkj.pojos.TallydetailsTable;
@Mapper
public interface TallyTableMapper {
	/**
	 * 查询记账单BY  liveID
	 * @param LiveID
	 * @return
	 */
	public List<TallyTable> findAllTallyByLiveID(
			@Param("LiveID") String LiveID);
	/**
	 * 根据账单号查询未核算详情
	 * @return
	 */
	public List<TallydetailsTable> findAllNoAccountTallydetailsByTallyID(
			@Param("tallyID") String tallyID);
	/**
	 * 根据账单号查询详情
	 * @return
	 */
	public List<TallydetailsTable> findAllTallydetailsByTallyID(
			@Param("tallyID") String tallyID);
	/**
	 * 根据住院ID查询未核算的账单
	 * @param LiveID
	 * @return
	 */
	public List<TallyTable> findAllTallyByLiveIDAndNoAccount(
			@Param("LiveID") String LiveID);
	/**
	 * 根据住院ID查询已经核算未结算的账单
	 * @param LiveID
	 * @return
	 */
	public List<TallyTable> findAllTallyByLiveIDAndNoPayHasAccount(
			@Param("LiveID") String LiveID);
	/**
	 * 查询缴费单BY  liveID
	 * @param LiveID
	 * @return
	 */
	public List<PayTable> findAllPayByLiveID(
			@Param("LiveID") String LiveID);
	/**
	 * 根据费用类型查询收费项目
	 * @param typeID
	 * @return
	 */
	public List<Map<String,Object>> findChargeProjectByType(@Param("typeID")Long typeID);
	/**
	 * 根据费名字查询收费项目
	 * @param name
	 * @return
	 */
	public List<Map<String,Object>> findChargeProjectByName(@Param("name")String name);
	/**
	 * 查询全部费用类型封装成树结构
	 * @return
	 */
	public List<Map<String,Object>> findAllChargetypeToTree();
	/**
	 * 统计未结费用
	 * @param liveID
	 * @return
	 */
	public BigDecimal sumNoPayTally(
			@Param("liveID") String liveID);
	/**
	 * 统计已结费用
	 * @param liveID
	 * @return
	 */
	public BigDecimal sumHasPayTally(
			@Param("liveID") String liveID);
	/**
	 * 统计全部结费用
	 * @param liveID
	 * @return
	 */
	public BigDecimal sumAllTally(
			@Param("liveID") String liveID);
	/**
	 * 查询未核算的账单信息
	 * @return
	 */
	public List<Map<String,Object>> findNoAcountTally();
	

}
